<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<s:include value="/include/header/header.jsp"></s:include>
	Offering
<s:include value="/include/header/mainNav.jsp"></s:include>
	<!--NAV ENDS HERE-->
    <!--DISPLAY STARTS HERE-->
    <div id="display">
    <!--DISPLAY INNER STARTS HERE-->
	<div id="display-inner">
		<h1>Offering</h1>
		<table>
			<tr>
				<td class="table-width">Option</td>
				<td class="table-width">ID</td>
				<td class="table-width">Description</td>
				<td class="table-width">Service Type</td>
				<td class="table-width">Base Rate</td>
				<td class="table-width">Limit</td>
				<td class="table-width">Step 1 Unit</td>
				<td class="table-width">Step 1 Rate</td>
				<td class="table-width">Step 2 Unit</td>
				<td class="table-width">Step 2 Rate</td>
			</tr>
			<s:iterator value="offerings" var="off">
				<tr>
					<td class="table-width"><a href="offering.action?offeringId=<s:property value='#off.id'/>">Edit</a></td>
					<td class="table-width"><s:property value="#off.id" /></td>
					<td class="table-width"><s:property value="#off.description" /></td>
					<td class="table-width"><s:property value="#off.serviceType.description" /></td>
					<td class="table-width"><s:property value="getText('format.money', {#off.baseRate} )" /></td>
					<td class="table-width"><s:property value="#off.limit" /></td>
					<td class="table-width"><s:property value="#off.step1Unit" /></td>
					<td class="table-width"><s:property value="getText('format.money', {#off.step1Rate} )" /></td>
					<td class="table-width"><s:property value="#off.step2Unit" /></td>
					<td class="table-width"><s:property value="getText('format.money', {#off.step2Rate} )" /></td>
				</tr>
			</s:iterator>

		</table>

		<form action="offering" >
			<p class="paragraph-form">
				<s:textfield name="offering.description" label="Description" cssClass ="input-field" />
			</p>
			<p class="paragraph-form">
					<s:select label="ServiceType"
						name="serviceType"
						value="offering.serviceType.id"
   						list="serviceTypes"
   						cssClass="dropdown" 
   						listKey="id"
   						listValue="description"/>
			</p>
			<p id="table" class="paragraph-form">
				<s:textfield name="offering.priceInfo.price" label="Price" cssClass ="input-field" />
			</p>
			<p id="table" class="paragraph-form">
				<s:textfield name="offering.ratekey" label="RateKey" cssClass ="input-field" />
			</p>
			<p>
				<s:hidden name="offering.id" />
				<s:submit value="Create" id="submit-button-2" />
			</p>
			<br>
		</form>

		<s:include value="/include/footer/footer.jsp"></s:include>		
